package com.example.popup;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import core.exception.BaseException;


public class Alert {
    public static void error(final Activity activity, BaseException e) {
        AlertDialog.Builder builder = new AlertDialog.Builder(activity);
        builder.setTitle("Error!");
        builder.setMessage(e.getReason());
        builder.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int i) {
                dialog.cancel();
                activity.finish();
            }
        });
        builder.create().show();
    }
}
